from django.urls import path, re_path
from . import views

urlpatterns = [
    path("index/", views.index),

    # """re_path支持正则"""
    # http://127.0.0.1:8000/user/info/10/
    re_path(r"^info/(?P<id>\d+)/$", views.info),
    # http://127.0.0.1:8000/user/goods/5/10/
    re_path(r"^goods/(?P<cat_id>\d+)/(?P<attr_id>\d+)/$", views.goods),

    # """路由转换器，用path实现正则效果"""
    path("rev/<int:num>/", views.inbuild_reverse),
    # 下面两个报错了，不知道为啥
    path("rev/<str:content>/", views.inbuild_reverse2),
    path("rev/<uuid:ustr>/", views.inbuild_reverse3),
]